---
title: ProcessOB3PRetention arguments
summary: Named command-line argument contract, syntax forms, defaults, validation, and exit behavior.
status: draft
owner: Documents
last_reviewed: 2026-10-06
---

# ProcessOB3PRetention arguments

The application accepts three optional named integer arguments that together define the processing date sent to the Imaging API. They are declared in `ArgContainer` and parsed by the framework's argument resolver.

## Argument contract

| Argument | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `Day` | `int` | No | Current day of month | Day component of the processing date |
| `Month` | `int` | No | Current month | Month component of the processing date |
| `Year` | `int` | No | Current year | Year component of the processing date |

Defaults are captured from `DateTime.Now` when arguments are resolved, using the machine's local time. Each argument can be overridden independently, so supplying only `Day` combines it with the current month and year. See [BR-OB3P-001](business-rules.md#br-ob3p-001-processing-date-defaults-to-current-date).

## Per-argument resolvers and validation

Each argument is configured in `ArgContainer.BuildArgumentResolvers` (`ArgContainer.cs`, lines 21-29) with `argumentResolverBuilder.Setup(selector, parser).NotRequired(default)`. The parser is `!string.IsNullOrEmpty(y) ? int.Parse(y) : default<Name>`.

| Argument | Required or optional | Resolver and optional marker | Validation | Failure message |
| --- | --- | --- | --- | --- |
| `Day` | Optional | `Setup(x => x.Day, parser)` with `.NotRequired(defaultDay)` (`ArgContainer.cs:26`) | Parseable as `Int32` only; no 1-31 range check* | `DAY '<value>' is not a valid Int32.`† |
| `Month` | Optional | `Setup(x => x.Month, parser)` with `.NotRequired(defaultMonth)` (`ArgContainer.cs:27`) | Parseable as `Int32` only; no 1-12 range check* | `MONTH '<value>' is not a valid Int32.`† |
| `Year` | Optional | `Setup(x => x.Year, parser)` with `.NotRequired(defaultYear)` (`ArgContainer.cs:28`) | Parseable as `Int32` only; no range check* | `YEAR '<value>' is not a valid Int32.`† |

When any resolver fails, `ResolveArguments` collects the messages, writes `Invalid arguments list (n total):` followed by the messages to stderr, sets exit code 1, calls `Console.ReadLine()`, and returns without running the application.† Whether `Console.ReadLine()` blocks an unattended run is not confirmed.**

## Syntax forms

The framework accepts these forms:†

| Form | Example |
| --- | --- |
| `-Name value` | `-Month 3` |
| `--Name value` | `--Month 3` |
| `/Name value` | `/Month 3` |
| `Name:value` | `Month:3` |
| `Name=value` | `Month=3` |
| `-Name:value` | `-Month:3` |
| `/Name=value` | `/Month=3` |

## Validation

- Each value is parsed with `int.Parse`; a non-numeric value fails resolution with a message such as `DAY 'x' is not a valid Int32.` (likewise for `MONTH` and `YEAR`).
- A bare flag with no value binds the text `true`, which is rejected by the same check.
- No range validation is applied: values such as month 13 or day 0 are accepted by the console application and passed to the Imaging API unchanged.* See [Tech debt](tech-debt.md).
- On success the framework echoes each resolved value, for example `* Resolved argument - DAY: 31`.†

## Exit behavior

A validation failure writes `Invalid arguments list (n total):` and the messages to stderr and ends the run with exit code 1 before any service is contacted. See [Run lifecycle](run-lifecycle.md).

## Examples

```text
ProcessOB3PRetention.exe
ProcessOB3PRetention.exe -Year 2026 -Month 3 -Day 31
ProcessOB3PRetention.exe Month=3 Year=2026
```

## Related documentation

| Documentation | Description |
| --- | --- |
| [Index](index.md) | Documentation entry point |
| [Overview](overview.md) | Purpose and capabilities |
| [Architecture](architecture.md) | Components and composition root |
| [Run lifecycle](run-lifecycle.md) | Execution flow and exit codes |
| [Configuration](configuration.md) | Settings and environment variables |
| [Dependencies](dependencies.md) | Packages and API dependencies |
| [Operations and processes](operations-processes.md) | Operation catalog |
| [Business rules](business-rules.md) | Rules enforced during processing |
| [Operational runbook](operational-runbook.md) | Run and recovery procedures |
| [Tech debt](tech-debt.md) | Technical debt observations |

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI. Statements marked with `*` were inferred
> from code structure or contextual evidence. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources

- `ProcessOB3PRetention/ArgContainer.cs`
- `ProcessOB3PRetention/Program.cs`
- `ProcessOB3PRetention/ThirdPartyRetentionProcessor.cs`
